public class O22 {
    public ListNode getKthFromEnd(ListNode head, int k) {
        ListNode listNode = head;
        int i = 0;
        while (head!=null){
            if (k==i){
                listNode = listNode.next;
            }else i++;
            head = head.next;
        }
        return listNode;
    }
}
